package com.hdd.biz.finance.controller;


import com.hdd.biz.finance.dto.PaymentRequest;
import com.hdd.biz.finance.dto.PaymetListRequest;
import com.hdd.biz.finance.service.PaymetService;
import com.hdd.dto.SuperRequest;
import com.hdd.dto.SuperResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

/**
 * <p>
 * 支付记录 前端控制器
 * </p>
 *
 * @author fang
 * @since 2021-03-09
 */
@RestController
@RequestMapping("/finance/paymet")
@Api(value = "充值流水",tags = {"充值流水"})
@CrossOrigin(origins = "*",maxAge = 3600)
public class PaymetController {

    @Autowired
    private PaymetService paymetService;

    @PostMapping("/record")
    @ApiOperation(value = "充值记录" ,notes = "")
    public SuperResponse record(@Valid @RequestBody PaymetListRequest request ){
        return paymetService.list(request);
    }


    @PostMapping("/checkOrder")
    @ApiOperation(value = "订单校验" ,notes = "")
    public SuperResponse checkOrder(@Valid @RequestBody PaymentRequest request ){
        return paymetService.checkOrder(request);
    }


}

